package com.example.demo.interview.ali.q20200423;

/**
 * @author liweizhi
 * @date 2020/4/28
 *
 * System.out.println(1.0 / 0); 的结果是什么？
 *
 * A. 抛出异常
 * B. Infinity
 * C. NaN
 *
 * Infinity
 */
public class Test003 {
    public static void main(String[] args) {
        // Infinity
        System.out.println(1.0 / 0);
        // Infinity
        System.out.println(1.0 / 0.0);
        // Infinity
        System.out.println(1 / 0.0);

        // NaN
        System.out.println(0.0 / 0.0);
        // NaN
        System.out.println(0.0 / 0);
        // NaN
        System.out.println(0 / 0.0);

        // java.lang.ArithmeticException: / by zero
//        System.out.println(0 / 0);
        // java.lang.ArithmeticException: / by zero
//        System.out.println(1 / 0);

    }
}
